﻿using nhCore.db;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nhCore.Modbus
{
    public class NullDecoder: WeatherDecoder
    {
        private readonly byte _addr;
        private readonly uint _reg;

        public NullDecoder(byte addr, uint reg)
        {
            Name = "空值解码器，针对计算要素";
            ElementConfig = new ElementConfig();
            _addr = addr;
            _reg = reg;
        }


        public override double? DeCode(FrameValid mb)
        {
            return CoreGlobal.计算要素[_addr][_reg];
        }
    }
}
